package hr.infomare.drrh.pojo;

// Generated 16.06.2011. 15:40:00 by Hibernate Tools 3.2.1.GA

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import budgetuserlibrary.gw.fmis.ibm.hr.infotypes.ResponseMessageType;
import budgetuserlibrary.gw.fmis.ibm.hr.messages.VendorResponseMsg;
import budgetuserlibrary.gw.fmis.ibm.hr.messages.VendorRetrieveResponseMsg;

/**
 * Vendormsg generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "VENDORMSG")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public class Vendormsg implements java.io.Serializable {

	private int idVendorm;
	private Reqmsg reqmsg;
	private String systemlogn;
	private String f41ctr;
	private byte opt;
	private String title;
	private String name;
	private String oib;
	private String taxnumber;
	private char naturalpe;
	private String language;
	private String vendorgro;
	private String street;
	private String housenumb;
	private String city;
	private String zipcode;
	private String country;
	private String email;
	private String fax;
	private String telephone;
	private String vendorid;
	private String sapvendori;
	private byte status;
	private String user;
	private int datetime;
	private Date datetimews;
	private Date timews;

	public Vendormsg() {
	}

	@Id
	@Column(name = "ID_VENDORM", unique = true, nullable = false, precision = 9, scale = 0)
	public int getIdVendorm() {
		return this.idVendorm;
	}

	public void setIdVendorm(int idVendorm) {
		this.idVendorm = idVendorm;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "REQMSGID")
	public Reqmsg getReqmsg() {
		return this.reqmsg;
	}

	public void setReqmsg(Reqmsg reqmsg) {
		this.reqmsg = reqmsg;
	}

	@Column(name = "SYSTEMLOGN", nullable = false, length = 10)
	public String getSystemlogn() {
		return this.systemlogn;
	}

	public void setSystemlogn(String systemlogn) {
		this.systemlogn = systemlogn;
	}

	@Column(name = "F41CTR", nullable = false, length = 7)
	public String getF41ctr() {
		return this.f41ctr;
	}

	public void setF41ctr(String f41ctr) {
		this.f41ctr = f41ctr;
	}

	@Column(name = "OPT", nullable = false, precision = 2, scale = 0)
	public byte getOpt() {
		return this.opt;
	}

	public void setOpt(byte opt) {
		this.opt = opt;
	}

	@Column(name = "TITLE", nullable = false, length = 20)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "NAME", nullable = false, length = 120)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "OIB", nullable = false, length = 20)
	public String getOib() {
		return this.oib;
	}

	public void setOib(String oib) {
		this.oib = oib;
	}

	@Column(name = "TAXNUMBER", nullable = false, length = 20)
	public String getTaxnumber() {
		return this.taxnumber;
	}

	public void setTaxnumber(String taxnumber) {
		this.taxnumber = taxnumber;
	}

	@Column(name = "NATURALPE", nullable = false, length = 1)
	public char getNaturalpe() {
		return this.naturalpe;
	}

	public void setNaturalpe(char naturalpe) {
		this.naturalpe = naturalpe;
	}

	@Column(name = "LANGUAGE", nullable = false, length = 20)
	public String getLanguage() {
		return this.language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	@Column(name = "VENDORGRO", nullable = false, length = 20)
	public String getVendorgro() {
		return this.vendorgro;
	}

	public void setVendorgro(String vendorgro) {
		this.vendorgro = vendorgro;
	}

	@Column(name = "STREET", nullable = false, length = 120)
	public String getStreet() {
		return this.street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	@Column(name = "HOUSENUMB", nullable = false, length = 40)
	public String getHousenumb() {
		return this.housenumb;
	}

	public void setHousenumb(String housenumb) {
		this.housenumb = housenumb;
	}

	@Column(name = "CITY", nullable = false, length = 120)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "ZIPCODE", nullable = false, length = 40)
	public String getZipcode() {
		return this.zipcode;
	}

	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}

	@Column(name = "COUNTRY", nullable = false, length = 10)
	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	@Column(name = "EMAIL", nullable = false, length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "FAX", nullable = false, length = 50)
	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Column(name = "TELEPHONE", nullable = false, length = 50)
	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(name = "VENDORID", nullable = false, length = 50)
	public String getVendorid() {
		return this.vendorid;
	}

	public void setVendorid(String vendorid) {
		this.vendorid = vendorid;
	}

	@Column(name = "SAPVENDORI", nullable = false, length = 50)
	public String getSapvendori() {
		return this.sapvendori;
	}

	public void setSapvendori(String sapvendori) {
		this.sapvendori = sapvendori;
	}

	@Column(name = "STATUS", nullable = false, precision = 2, scale = 0)
	public byte getStatus() {
		return this.status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	@Column(name = "USER", nullable = false, length = 10)
	public String getUser() {
		return this.user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	@Column(name = "DATETIME", nullable = false, precision = 8, scale = 0)
	public int getDatetime() {
		return this.datetime;
	}

	public void setDatetime(int datetime) {
		this.datetime = datetime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "DATETIMEWS", length = 10)
	public Date getDatetimews() {
		return this.datetimews;
	}

	public void setDatetimews(Date datetimews) {
		this.datetimews = datetimews;
	}

	@Temporal(TemporalType.TIME)
	@Column(name = "TIMEWS", length = 8)
	public Date getTimews() {
		return this.timews;
	}

	public void setTimews(Date timews) {
		this.timews = timews;
	}

	public void postaviVrijednosti(byte status, Reqmsg reqMsg, Date dateTimeWS,
			VendorResponseMsg response) {
		this.status = status;
		this.reqmsg = reqMsg;
		this.datetimews = dateTimeWS;
		this.timews = dateTimeWS;
		/*
		 * if (response != null && response.getVendor() != null) {
		 * this.sapvendori = response.getVendor().getSapVendorId();
		 * this.vendorid = Long.toString(response.getVendor().getVendorId()); }
		 */
	}

	public void postaviVrijednostiRetrieve(byte status, Reqmsg reqMsg,
			Date dateTimeWS, VendorResponseMsg response) {
		this.status = status;
		this.reqmsg = reqMsg;
		this.datetimews = dateTimeWS;
		this.timews = dateTimeWS;
		if (response.getResponseMessageType().equals(
				ResponseMessageType.NOTIFICATION)) {
			this.sapvendori = response.getVendor().getSapVendorId();
			this.vendorid = Long.toString(response.getVendor().getVendorId());
		}
	}
	
	public void postaviVrijednostiRetrieve(byte status, Reqmsg reqMsg,
			Date dateTimeWS, VendorRetrieveResponseMsg response) {
		this.status = status;
		this.reqmsg = reqMsg;
		this.datetimews = dateTimeWS;
		this.timews = dateTimeWS;
		if (response.getResponseMessageType().equals(
				ResponseMessageType.NOTIFICATION)) {
			this.sapvendori = response.getVendor().getSapVendorId();
			this.vendorid = Long.toString(response.getVendor().getVendorId());
		}
	}
}
